package com.example.cores_middle_activity;

import android.os.Bundle;
import android.view.View;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

public class DrawableShape extends AppCompatActivity implements View.OnClickListener {

    private View viewContent;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_drawable_shape);

        viewContent = findViewById(R.id.v_content);
        findViewById(R.id.btn_rectangle).setOnClickListener(this);
        findViewById(R.id.btn_oval).setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        int id = view.getId();
        if (id == R.id.btn_rectangle) {
            viewContent.setBackgroundResource(R.drawable.shape_rectangle_round);
        } else if (id == R.id.btn_oval) {
            viewContent.setBackgroundResource(R.drawable.shape_oval);
        }
    }
}